<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0,maximum-scale=1.0,user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes" />
		<!--iPhone私有标签，它表示：允许全屏模式浏览-->
		<meta name="apple-mobile-web-app-status-bar-style" content="black" />
		<!--iPhone私有标签，它指定的iPhone中safari顶端的状态条的样式-->
		<meta name="format-detection" content="telephone=no; email=no" />

		<!--清楚浏览器缓存-->
		<meta HTTP-EQUIV="pragma" CONTENT="no-cache">
		<meta HTTP-EQUIV="Cache-Control" CONTENT="no-store, must-revalidate">
		<meta HTTP-EQUIV="expires" CONTENT="Wed, 26 Feb 1997 08:21:57 GMT">
		<meta HTTP-EQUIV="expires" CONTENT="0">

		<!--不识别邮件和不把数字识别为电话号码-->
		<link rel="stylesheet" type="text/css" href="assets/css/ydui.css" />
		<link rel="stylesheet" type="text/css" href='assets/css/index.css?fh500=' + new Date().getTime() />
		<link rel="stylesheet" type="text/css" href="assets/css/reset.css" />

		<script src="assets/js/ydui.flexible.js"></script>

		<title>芯球泊车</title>

		<style type="text/css">
			body {
				-webkit-touch-callout: none;
				-webkit-user-select: none;
				-khtml-user-select: none;
				-moz-user-select: none;
				-ms-user-select: none;
				user-select: none;
			}
			
			.borderLeft {
				border-right: 1px solid green;
			}
		</style>

	</head>

	<body>

		<!--防止重复点击的-->

		<div class="repeat_shadow">

		</div>

		<!--这边是展示的图片-->
		<div class="show_img">
			<img class="imgSrc" src="" />
		</div>

		<div class="Keyboard">
		</div>

		<!--这边是纯数字键盘-->

		<div class="readyNumKeyboard">
			<div class="readyNum">1</div>
			<div class="readyNum">2</div>
			<div class="readyNum">3</div>
			<div class="readyNum">4</div>
			<div class="readyNum">5</div>
			<div class="readyNum">6</div>
			<div class="readyNum">7</div>
			<div class="readyNum">8</div>

			<div class="readyNum">9</div>
			<div class="readyNum" style="background-color: #CACACA;">*</div>
			<div class="readyNum">0</div>
			<div class="deleteShengReadyNum delete_common">

			</div>

		</div>

		<div class="shengKeyboard">
			<div class="sheng">京</div>
			<div class="sheng">沪</div>
			<div class="sheng">鄂</div>
			<div class="sheng">湘</div>
			<div class="sheng">川</div>
			<div class="sheng">渝</div>
			<div class="sheng">粤</div>
			<div class="sheng">闽</div>
			<div class="sheng">晋</div>
			<div class="sheng">黑</div>
			<div class="sheng">津</div>
			<div class="sheng">浙</div>
			<div class="sheng">豫</div>
			<div class="sheng">赣</div>
			<div class="sheng">贵</div>
			<div class="sheng">青</div>
			<div class="sheng">琼</div>
			<div class="sheng">宁</div>
			<div class="sheng">蒙</div>
			<div class="sheng">吉</div>
			<div class="sheng">冀</div>
			<div class="sheng">苏</div>
			<div class="sheng">皖</div>
			<div class="sheng">桂</div>
			<div class="sheng">云</div>
			<div class="sheng">陕</div>
			<div class="sheng">甘</div>
			<div class="sheng">藏</div>
			<div class="sheng">新</div>
			<div class="sheng">辽</div>
			<div class="sheng">鲁</div>
			<div class="deleteSheng">

			</div>

		</div>

		<!--车牌号码键盘-->
		<div class="num_row  numberKeyboard">
			<div class="num_g">1</div>
			<div class="num_g">2</div>
			<div class="num_g">3</div>
			<div class="num_g">4</div>
			<div class="num_g">5</div>
			<div class="num_g">6</div>
			<div class="num_g">7</div>
			<div class="num_g">8</div>
			<div class="num_g">9</div>
			<div class="num_g">0</div>
			<div class="num_g">Q</div>
			<div class="num_g">W</div>
			<div class="num_g">E</div>
			<div class="num_g">R</div>
			<div class="num_g">T</div>
			<div class="num_g">Y</div>
			<div class="num_g">U</div>
			<div class="num_g" style="background-color: #CACACA;">I</div>
			<div class="num_g">O</div>
			<div class="num_g">P</div>
			<div class="num_g">A</div>
			<div class="num_g">S</div>
			<div class="num_g">D</div>
			<div class="num_g">F</div>
			<div class="num_g">G</div>
			<div class="num_g">H</div>
			<div class="num_g">J</div>
			<div class="num_g">K</div>
			<div class="num_g">L</div>
			<div class="num_g">Z</div>

			<div class="num_g">X</div>
			<div class="num_g">C</div>
			<div class="num_g">V</div>
			<div class="num_g">B</div>
			<div class="num_g">N</div>
			<div class="num_g">M</div>
			<div class="num_g">港</div>
			<div class="num_g">澳</div>

			<div class="delete delete_common">

			</div>
		</div>

		<section class="g-flexview">

			<!--<header class="m-navbar">
				<a  class="navbar-item"><i class="back-ico"></i></a>
				<div class="navbar-center"><span class="navbar-title">芯球泊车</span></div>
			</header>-->

			<section class="g-scrollview">

				<div class="img_top">

					<img class="parking" src="" alt="" />

				</div>
				<section class="next">

					<div>
						<span class="parking_code tabColor">
						取车码
					</span>
						<span class="carNumber">
						车牌
					</span>
					</div>

					<div class="tab_contentBox">

						<!--这个是停车码切换的内容-->
						<div class="tab_parkingContent">
						</div>

						<!--这个是车牌切换的内容-->
						<div class="tab_carNumberContent">
							<section class="search_box">

								<div class="input_box">
									<!--<input type="text" name="" id="" value="" />-->

									<div class="jianCheng" style="display: none;">
										<div class="name">京</div>
										<img class="down" src="assets/img/down.png" />
									</div>

									<div class="NumberCode_box">
										<!--<div  ></div>-->
										<div class="NumberCodeFather">
											<span class="NumberCode"></span>
										</div>
									</div>

								</div>
								<!--这边是搜索框-->
								<div class="search">
									<img src="assets/img/search.png" />

								</div>

							</section>
							<!--下方搜索出来的东西-->

							<div class="section_list">

								<section class="details_box ">
									<div class="details_top">
										<div class="adress_box">
											<div class="name_box">
												<span class="parking_name"></span>
												<span class="parking_number"></span>

											</div>
											<div class="address">

												<img class="mapBiaoZhi" src="assets/img/location.png" alt="" />
												<div class="address_details"></div>

											</div>

										</div>
										<div class="time_box">
											<section class="row_list">
												<div class="list_left" style="margin-top: 0.04rem;">入场时间</div>
												<!--<div class="list_middle">查看照片</div>-->
												<div class="list_right" style="margin-top: 0.04rem;"></div>

											</section>
											<section class="row_list">
												<div class="list_left">出场时间</div>
												<div class="list_right"></div>

											</section>
											<section class="row_list">
												<div class="list_left">停车时长</div>
												<div class="list_right"></div>

											</section>

										</div>

									</div>
									<div class="datails_next">
										<section class="row_list">
											<div class="list_left">取物次数</div>
											<div class="list_right fetchTimes"></div>

										</section>
										<section class="row_list">
											<div class="list_left">需支付</div>
											<div class="list_right"></div>

										</section>

									</div>

								</section>

							</div>

						</div>

					</div>

				</section>

				<!--这边是支付的按钮-->
				<div class="pay" style="margin-bottom: 0.30rem;">
					支付
				</div>

			</section>

		</section>

		<input type="hidden" name="RSACommonKey" id="RSACommonKey" value="MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAhMoW4ITp5Oi9N03N340mPUS+I9ymQ+jKgJl/og9ZuPVKyOn0rP7WjAz5NZpaNIVYaGWqGeZMa9I75A+JK2fbXaOvjkpkgnS2NPySVD+kQ9YHOKQR7sbJ/YX+O+JGYQwNXN3vUG/TWgPuGtYeqnSpDM/Q3+tvLkA68XL0xH2If0lsrAZiLdcgnmbPCelZ3e5HpU+F/HhlCc7JCP8cKBa2dThv93rUnVzl1c9FLbUFaa2eZ1y68Ybf0y8qZJ7JumT5KBrv5fJY4mzda1QC8Ug6UoAHbLsXzU7Z20AoeLFuRVfKmpoh+Z7zBZcIr0uSMvw/KaVXI4Fex0OTbMV4elpJLQIDAQAB" />

	</body>

	<script type="text/javascript" src="assets/js/jquery-1.8.3.min.js"></script>
	<script type="text/javascript" src="assets/js/ydui.js"></script>
	<script type="text/javascript" src="assets/js/vconsole.js"></script>

	<script type="text/javascript" src="assets/js/api.js?fjgmll=" +new Date().getTime()></script>
	<script type="text/javascript" src="assets/js/jsencrypt.js">
	</script>

	<script type="text/javascript" src="assets/js/jweixin-1.0.0.js">
	</script>

	<script>
		//禁止默认事件；
		var dialog = window.YDUI.dialog;

		//定义一个车牌号或取车码的
		var type = 2; //  2代表着取车码的类型   1 代表着车牌号的类型；
		var businessNo = null;

		var carInfoId = null;

		var t2 = null;

		var money = null;

		var noStr = null;

		var This = null;

		//定义一些全局变量

		var localAddress = null;
		var localParkName = null;

		var pageTimer = {}; //定义计算器全局变量

		var indNum = 1;

		//车牌号：

		//点击查看图片，弹出图片
		$(".list_middle").live("click", function() {

			var imgPath = $(this).attr("imgPath");

			$('.imgSrc').attr('src', imgPath)

			$(".show_img").show()
		})

		$(".show_img, .show_img img").live("click", function() {
			$(".show_img").fadeOut()
		})

		//点击切换车牌和停车吗

		$(".parking_code").live("click", function() {
			$(this).addClass("tabColor");
			$(".carNumber").removeClass("tabColor");

			$(".jianCheng").hide();
			$(".NumberCode").text("");

			$(".NumberCode").removeClass("borderLeft")

			type = 2;

			changeHtml()
		})

		$(".carNumber").live("click", function() {
			$(this).addClass("tabColor");
			$(".parking_code").removeClass("tabColor");
			$(".jianCheng").show();
			$(".NumberCode").text("");
			type = 1;
			$(".NumberCode").removeClass("borderLeft")

			changeHtml()
		})

		//点击键盘空白处，输入消失

		$(".Keyboard").live("click", function() {
			$(this).hide()
			$(".numberKeyboard,.shengKeyboard,.readyNumKeyboard").hide()

		})

		//点击省份简称出现的键盘
		$(".jianCheng").live("click", function() {
			$(".Keyboard").show()
			$(".shengKeyboard").show()

		})

		//点击省份简称键盘
		$(".sheng").live("click", function() {
			var name = $(this).text()
			$(".name").text(name)
			//			$(".Keyboard,.shengKeyboard").hide()

		})

		//车牌号键盘
		$(".num_g").live("click", function() {

			if($(this).text() == "I") {

			} else {

				var Num = $(this).text();
				var NumberCode = $(".NumberCode").text();
				NumberCode += Num

				$(".NumberCode").text(NumberCode);

			}

		})

		//这边是纯数字键盘
		$(".readyNum").live("click", function() {

			if($(this).text() == "*") {

			} else {

				var Num = $(this).text();
				var NumberCode = $(".NumberCode").text();

				if(NumberCode.length < 6) {
					NumberCode += Num

				} else {
					NumberCode = NumberCode;

					dialog.toast('取车码不能超过6位数', 'none', 1000);

				}

				$(".NumberCode").text(NumberCode);

			}

		})

		$(".delete_common").on({
			touchstart: function(e) {
				// 长按事件触发  
				timeOutEvent = setTimeout(function() {
					timeOutEvent = 0;

					var oDiv = document.getElementsByClassName("NumberCode")[0];
					var oDivHtml = oDiv.innerHTML;
					oDiv.innerHTML = "";

				}, 400);
				//长按400毫秒   
				e.preventDefault();
			},
			touchmove: function() {
				clearTimeout(timeOutEvent);
				timeOutEvent = 0;
			},
			touchend: function() {
				clearTimeout(timeOutEvent);
				if(timeOutEvent != 0) {
					var oDiv = document.getElementsByClassName("NumberCode")[0];
					var oDivHtml = oDiv.innerHTML;
					oDiv.innerHTML = oDivHtml.substring(0, oDivHtml.length - 1);
				}
				return false;
			}
		})

		$(".canPay").live("click", function() {

			canPay(noStr)

		})

		function canPay(noStr) {

			var encrypt = new JSEncrypt();

			var RSACommonKey = $("#RSACommonKey").val()
			encrypt.setPublicKey(RSACommonKey);

			var dataa = {
				"carInfoId": carInfoId,
				"payType": 2,
				"money": money,
				"datetime": new Date().getTime(),
				"noStr": noStr
			};

			var str = JSON.stringify(dataa);

			var encryMoney = encodeURIComponent(encrypt.encrypt(str));
			console.log(encryMoney);

			var dat = {
				"send": encryMoney,
			}

			ajaxJson('get', 'app/picCode/surePay?send=' + encryMoney, '', function(data) {

				paySubmit(data);

			});
			//			

		}

		function paySubmit(data) {
			if(typeof WeixinJSBridge == "undefined") {
				if(document.addEventListener) {
					document.addEventListener('WeixinJSBridgeReady', onBridgeReady, false);
				} else if(document.attachEvent) {
					document.attachEvent('WeixinJSBridgeReady', onBridgeReady);
					document.attachEvent('onWeixinJSBridgeReady', onBridgeReady);
				}
			} else {
				onBridgeReady(data);
			}
		}

		function onBridgeReady(data) {

			window.localStorage.setItem("outTradeNo", data.result.outTradeNo);

			WeixinJSBridge.invoke('getBrandWCPayRequest', {
					"appId": data.result.appId,
					"timeStamp": data.result.timeStamp,
					"nonceStr": data.result.nonceStr,
					"package": data.result.packages,
					"signType": data.result.signType,
					"paySign": data.result.paySign
				},
				function(res) {
					if(res.err_msg == "get_brand_wcpay_request:ok") {

						window.location.href = 'paySuccess.html?fjgml=' + new Date().getTime();
					} else {
						//						window.location.href = 'index.html';
					}

				});
		}

		//这边是点击后面的号码出现的键盘
		$(".NumberCode_box").live("click", function() {

			if(type == 2) {

				$(".Keyboard").show()
				$(".readyNumKeyboard").show()
				$(".NumberCode").addClass("borderLeft")

			}

			if(type == 1) {
				$(".Keyboard").show()
				$(".numberKeyboard").show()
				$(".NumberCode").addClass("borderLeft")

			}

		})

		$(function() {

			//  根据code 获取token;
			var data = {
				"code": GetQueryString("code")
			};

			ajaxJson('post', 'app/weixinCode/getToken', data, function(data) {

				if(data.code == 200 && data.ifsuccess) {

					noStr = data.result.noStr;

				} else {
					dialog.toast(data.msg, 'none', 1000);
				}

			}, function() {

			});

			//						console.log(window.location)
			//						console.log("code")
			//						console.log(GetQueryString("code"))
			//						console.log("state")
			//						console.log(GetQueryString("state"))
			//						return;

			//刚进页面执行的函数，获取停车场信息；
			var data = [GetQueryString("businessNo")];

			window.localStorage.setItem("businessNo", GetQueryString("businessNo"));

			ajaxJson('get', 'app/picCode/searchParkInfo', data, function(data) {

				if(data.code == 200 && data.ifsuccess) {
					searchParkInfo(data.result)

					localAddress = data.result.parkAddress;
					localParkName = data.result.parkName;
					$(".address_details").text(localAddress)
					$(".parking_name").text(localParkName)

				} else {
					dialog.toast('获取停车场信息失败！', 'none', 1000);
				}

			}, function() {
				dialog.toast('获取停车场信息失败！', 'none', 1000);
			});

		})

		//点击搜索获取详情；
		$(".search").live("click", function() {
			
			
			clearTimer()

			//取车码
			if(type == 2) {

				var licenseOrCode = $(".NumberCode").text()

				var goodsLei = "取车码-" + licenseOrCode;

				if(licenseOrCode.length == 6) {

				} else {
					dialog.toast('取车码长度不正确', 'none', 1000);
					$(".NumberCode").text("")
					return;
				}

				if(!licenseOrCode) {
					dialog.toast('取车码不能为空', 'none', 1000);
					return;
				}

			}
			//这个是车牌号；
			if(type == 1) {
				var licenseOrCode = $(".name").text() + $(".NumberCode").text()

				var goodsLei = "车牌号-" + licenseOrCode;

				if(!$(".NumberCode").text()) {
					dialog.toast('车牌号不能为空', 'none', 1000);
					return;
				}

				if(!isCarNum(licenseOrCode)) {
					dialog.toast('请输入正确的车牌号', 'none', 1000);

					return;

				}

			}

			window.localStorage.setItem("goodsLei", goodsLei);

			var data = {
				"businessNo": businessNo,
				"licenseOrCode": licenseOrCode,
				"type": type

			};
			ajaxJson('post', 'app/picCode/queryCar', data, function(data) {

				if(data.code == 200 && data.ifsuccess) {
					queryCar(data.result)
				} else {
					dialog.toast(data.msg, 'none', 1000);
				}

			}, function() {

			});

		})

		//获取停车场信息
		function searchParkInfo(data) {

			//			$(".parking_name").text(data.parkName);
			//			$(".address_details").text(data.parkAddress);
			businessNo = data.businessNo;

		}
		//点击切换内容

		function changeHtml() {

			var result = ""
			result += '<section class="details_box">'
			result += '<div class="details_top">'
			result += '	<div class="adress_box">'
			result += '<div class="name_box">'

			if(localParkName) {
				result += '<span class="parking_name">' + localParkName + '</span>'
			} else {
				result += '<span class="parking_name">停车场</span>'
			}

			//				if(type == 1) {
			//					result += '<span class="parking_number">' + item.licenseOrCode + '</span>'
			//				}

			result += '</div>'
			result += '<div class="address">'

			result += '<img class="mapBiaoZhi" src="assets/img/location.png" alt="" />'

			//			if(item.parkAddress) {
			//				result += '<div class="address_details"></div>'
			//			} else {

			if(localAddress) {
				result += '<div class="address_details">' + localAddress + '</div>'

			} else {
				result += '<div class="address_details">-----</div>'
			}

			//			}

			result += '</div>'

			result += '</div>'
			result += '<div class="time_box">'
			result += '<section class="row_list">'
			result += '<div class="list_left" style="margin-top: 0.04rem;">入场时间</div>'
			//				result += '<div class="list_middle" imgPath = "' + item.path + '">查看照片</div>'
			result += '<div class="list_right" style="margin-top: 0.04rem;"></div>'

			result += '</section>'
			result += '<section class="row_list">'
			result += '<div class="list_left">出场时间</div>'
			result += '<div class="list_right"></div>'

			result += '</section>'
			result += '<section class="row_list">'
			result += '<div class="list_left">停车时长</div>'
			result += '<div class="list_right"></div>'

			result += '</section>'

			result += '</div>'

			result += '</div>'
			result += '<div class="datails_next">'
			result += '<section class="row_list">'
			result += '<div class="list_left">取物次数</div>'
			result += '<div class="list_right fetchTimes"></div>'

			result += '	</section>'
			result += '<section class="row_list">'
			result += '<div class="list_left">需支付</div>'
			//			result += '<div class="list_right"><span class="needMoney">9.00</span><span class="yuan">元</span></div>'
			result += '<div class="list_right  needPayHtml"></div>'

			result += '</section>'

			result += '</div>'

			result += '</section>'

			$(".section_list").html(result)

			$(".pay").removeClass("canPay");

		}

		//点击搜索
		function queryCar(data) {
			var status = ""
			var result = ""

			$.each(data, function(index, item) {

				carInfoId = item.carInfoId
				status = item.status

				//不是套牌车的的时候
				if(data.length == 1) {

					//已经付款过了
					if(status == 2) {
						$(".pay").hide()
						window.localStorage.setItem("carInfoId", carInfoId);
						window.location.href = 'paySuccessDirectory.html?fjgml=' + new Date().getTime();
						return;
					} else {
						loop()
					}
				}
				result += '<section class="details_box"  carInfoId="' + item.carInfoId + '"  status="'+item.status+'" >'
				result += '<div class="details_top">'
				result += '	<div class="adress_box">'
				result += '<div class="name_box">'
				result += '<span class="parking_name">' + item.parkName + '</span>'
				if(type == 1) {
					result += '<span class="parking_number">' + item.licenseOrCode + '</span>'
				}

				result += '</div>'
				result += '<div class="address">'

				result += '<img class="mapBiaoZhi" src="assets/img/location.png" alt="" />'

				if(item.parkAddress) {
					result += '<div class="address_details">' + item.parkAddress + '</div>'
				} else {
					result += '<div class="address_details">-----</div>'
				}

				result += '</div>'

				result += '</div>'
				result += '<div class="time_box">'
				result += '<section class="row_list">'
				result += '<div class="list_left" style="margin-top: 0.04rem;">入场时间</div>'
				result += '<div class="list_middle" imgPath = "' + item.path + '">查看照片</div>'
				result += '<div class="list_right" style="margin-top: 0.04rem;">' + timestampToTime(item.stayTime) + '</div>'

				result += '</section>'
				result += '<section class="row_list">'
				result += '<div class="list_left">出场时间</div>'
				result += '<div class="list_right">' + timestampToTime(item.leaveTime) + '</div>'

				result += '</section>'
				result += '<section class="row_list">'
				result += '<div class="list_left">停车时长</div>'
				result += '<div class="list_right">' + item.stayHour + '小时' + item.stayMinute + '分钟</div>'

				result += '</section>'

				result += '</div>'

				result += '</div>'
				result += '<div class="datails_next">'
				result += '<section class="row_list">'
				result += '<div class="list_left">取物次数</div>'
				result += '<div class="list_right fetchTimes"></div>'

				result += '	</section>'
				result += '<section class="row_list">'
				result += '<div class="list_left">需支付</div>'
				//			result += '<div class="list_right"><span class="needMoney">9.00</span><span class="yuan">元</span></div>'
				result += '<div class="list_right  needPayHtml"></div>'

				result += '</section>'

				result += '</div>'

				result += '</section>'

			})

			$(".section_list").html(result)

		}

		//当套牌车出现时；

		$(".details_box").live("click", function() {
			This = $(this)
			var length = $(".details_box").length;

			if(length > 1) {

				//先清除;
				$('.details_top').removeClass("borderColor")
				$(".datails_next").removeClass("borderColor")
				$(".pay").removeClass("canPay");
				$(this).find(".details_top").addClass("borderColor")
				$(this).find(".datails_next").addClass("borderColor")

				carInfoId = $(this).attr("carInfoId")
				
				window.localStorage.setItem("carInfoId", carInfoId);
				var status = $(this).attr("status")
				if(status==2){
					
					window.location.href = 'paySuccessDirectory.html?fjgml=' + new Date().getTime();
					 
					
				}else{
					loop()
				}

				

			}

		})

		//这边是执行一个轮训
		function loop() {
			indNum++
			var data = [carInfoId];
			
			var k = "timer" + indNum;

			pageTimer[k] = setInterval(function() {

				ajaxJson('get', 'app/picCode/searchMoney', data, function(data) {

					if(data.code == 200 && data.ifsuccess) {
						console.log(data)
						if(data.result.status == 1) {
							 clearInterval(pageTimer[k])
							
							money = data.result.money;

							if($(".details_box").length > 1) {

								This.find(".fetchTimes").text(data.result.totalBilling)
								This.find(".needPayHtml").html('<span class="needMoney">' + data.result.money + '</span><span class="yuan">元</span>');

							} else {
								$(".fetchTimes").text(data.result.totalBilling)
								$(".needPayHtml").html('<span class="needMoney">' + data.result.money + '</span><span class="yuan">元</span>');

							}

							$(".pay").addClass("canPay");
						} else {

						}

					} else {
						dialog.toast(data.msg, 'none', 1000);
					}

				}, function() {

				});

			}, 1000);

		}

		function clearTimer() {

			//全部清除方法
			for(var each in pageTimer) {
				clearInterval(pageTimer[each]);
			}

		}
	</script>

	<script type="text/javascript">
		function stateJudge() {

		}
		//时间戳变成日期格式
		function timestampToTime(timestamp) {
			var date = new Date(timestamp); //时间戳为10位需*1000，时间戳为13位的话不需乘1000
			Y = date.getFullYear() + '-';
			M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';
			D = date.getDate() < 10 ? "0" + date.getDate() + ' ' : date.getDate() + ' ';
			h = date.getHours() < 10 ? +"0" + date.getHours() + ':' : date.getHours() + ':';
			m = date.getMinutes() < 10 ? "0" + date.getMinutes() + ':' : date.getMinutes() + ':';
			s = date.getSeconds() < 10 ? "0" + date.getSeconds() + ' ' : date.getSeconds();
			return Y + M + D + h + m + s;
		}

		function GetQueryString(name) {
			var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
			var r = window.location.search.substr(1).match(reg);
			if(r != null) return unescape(r[2]);
			return null;
		}

		//验证车牌号

		function isCarNum(t) {
			var reg1 = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-Z0-9]{4}[A-Z0-9挂学警港澳]{1}$/;

			var reg2 = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}(([0-9]{5}[DF])|([DF][A-HJ-NP-Z0-9][0-9]{4}))$/;

			if(reg1.test(t) || reg2.test(t)) {
				return true;

			} else {
				return false;

			}

		};
	</script>

</html>